[Table of Contents] [docx version]
WordprocessingML Reference Material - Table of Contents
Most text in a word processing document is static; that is, unless it is directly changed as the result of editing, its contents remain the same, no matter how the rest of the document might change. However, certain useful pieces of information can change value over the life of a document. Consider the case of a reference to a page number, as in "For more information on this topic, seeĀ pageĀ 56." Clearly, hard coding the page number as 56 means that that number will need to be manually replaced as the document's size or layout is changed. Even a simple change to any margin, line spacing, or font size can invalid such references.
Fields provide a mechanism for placeholders, such as page reference numbers, that can be added to a document such that those placeholders are replaced by their corresponding values when the document is rendered for display or print. Other applications for fields include, but are not limited to, automatic numbering of tables and figures, document creation and current date and time, document author information, and the computation of totals for a table column.
A field is a set of codes that instructs a WordprocessingML consumer to insert text, graphics, page numbers, and other material into a document automatically. [Example: The DATE field causes the current date to be inserted. end example] The text or graphics inserted into a document when a consumer carries out a field's codes is referred to as the field result for that field. The act of carrying out a field's codes is referred to as a field update. As to how or when any field is updated is outside the scope of this Office Open XML Standard.